Class Main

java.lang.Object
edu.claflin.finder.Main

public class Main extends Object
Interprets the command line arguments provided to the program.
Version:
3.2 February 4, 2016
Author:
Charles Allen Schultz II
  • Constructor Details

    • Main

      public Main()
  • Method Details

    • main

      public static void main(String[] args)
      Command line argument processing occurs here. Program usage:     java -jar SubgraphFinder.jar -v -out <booleans> -log <booleans> [ -f <FILE> | -m <MANIFEST> ] -input <TYPE> <OPTION> -output <TYPE> <OPTION> -algo <ALGO>        -f <FILE> : Supply a single file to be parsed.        -m <MANIFEST> : Supply a manifest listing several files to be parsed.        -level <OPTION>            <OPTION> : A logging level.                NORMAL : Shallowest logging level. Least amount of messages.                VERBOSE : Moderate logging; includes intermittent operations.                DEBUG : Highest logging granularity; logs every message.        -out <booleans> :: -log <booleans>            out : Logging to command prompt options.            log : Logging to file options.            <booleans> : Use 't' for true and 'f' for false. The supplied arguments should                    be concatenated as a single string. There are currently four (4) needed:                ALGO : Logging of Algorithm operations.                ERRR : Logging of Error informations.                GRPH : Logging of Graph operations.                INFO : Logging of General informations.        -input <TYPE> :: -output <TYPE>            input : How to process the source graphs.            output : How to output the found graphs.            <TYPE> : Select from one of the following options:                SIMPLE : Simple tab delimited format. (DEFUALT)                SIF : Simple Interaction Format as defined in the Cytoscape Manual.                NOA : NOA Batch Format as defined in the NOA Plugin for Cytoscape. (OUTPUT ONLY)            <OPTION> : Some formats require an additional parameter described below:                SIF : Default Relationship Type (i.e. \"pp\" or \"pd\")                NOA : Same as SIF.        -cfg <OPTION> : Some algorithms receive special configuration parameters, all of which default to false.            <OPTIONS> : Select from one of the following options:                PRESERVATIVE : Preserves edges on expansion.        -type <OPTION> : A subgraph type to look for.            <OPTIONS> : Select from one of the following options:                BIPARTITE : Bipartite Subgraphs.                CLIQUE : Clique Subgraphs.                DCLIQUE : Directed Clique Subgraphs.        -order <OPTION> : An ordering to impose            <OPTIONS> : Select from one of the following options:                EDGEWEIGHT : Order expansion based on the data attached to the edge interpretted as a number.                    (Higher values are taken first.)        -undirected : Interprets a graph as being undirected.        -algo <ALGO> : The algorithm code indicating the method of finding BSGs to use.            <ALGO> : Select from one of the following options:                BFTS : Finds bipartite graphs based on a breadth first traversal search of the network.                DFTS : Finds bipartite graphs based on a depth first traversal search of the network.                BNDL : See below for instruction. (Do not self-reference. Program will exit with error.)        -algo BNDL <ALGO>( <ALGO> ...) : Load a BUNDLE Algorithm. Processes the graph using each                of the provided Algorithms. Algorithm codes should be the same as above and delimited                using spaces. NOTE: this must be the last argument as the program assumes all following                arguments are Algorithm codes.
      Parameters:
      args - the String array containing the program's startup parameters.
    • writeGraphs

      private static void writeGraphs(ArrayList<Graph> graphs, String output, GraphWriter writer)
      Writes Graph objects to memory. Does so in a manner so as to promote extensibility.
      Parameters:
      graphs - the ArrayList object containing the graphs to write.
      output - the String representing the folder in the memory to store the graphs in.
      writer - the GraphWriter object to use for writing the graphs.
    • parseBoolean

      private static boolean[] parseBoolean(String booleans)
      Parses a boolean string for configuring the {}. Converts the characters in the string into a boolean array depending on if they are 't' for true or 'f' for false.
      Parameters:
      booleans - the String containing the boolean pattern.
      Returns:
      the boolean array initialized from the String.
    • parseAlgorithm

      private static Algorithm parseAlgorithm(String algorithmCode, HashMap<String,Boolean> config, ArrayList<Condition> conditions, Comparator<Edge> comparator)
      Parses an algorithm code string for returning the appropriate Algorithm object.
      Parameters:
      algorithmCode - the String containing the correct Algorithm code.
      config - the configurations
      conditions - the conditions
      comparator - the Edge comparator
      Returns:
      the Algorithm object instantiated from the code.
    • error

      private static void error()
      Used to process a fatal error. Kills the program with a warning to the user.